import xbot
import xbot_visual
from . import package
from .package import variables as glv
import time

def main(args):
    error_innerText = None
    if args is None:
        error_innerText = None
    else:
        error_innerText = args.get("error_innerText", None)
    try:
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="您尝试解锁设备的次数过多", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 1, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="此设备由于提交解锁次数过多已被ATT官方限制，建议等待24小时后重新提交"
            , _block=("匹配err1的错误", 2, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="Looks like the IMEI number you entered doesn’t match an AT&T device.", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 4, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="您的设备不是AT&T运营商，请检查运营商。"
            , _block=("匹配err1的错误", 5, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="That IMEI number doesn't match any AT&T device. ", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 7, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="您的设备不是AT&T运营商，请检查运营商。"
            , _block=("匹配err1的错误", 8, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="不匹配", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 10, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="您的设备不是AT&T运营商，请检查运营商。"
            , _block=("匹配err1的错误", 11, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="We can't unlock your device until 60 days post-purchase.", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 13, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="解锁失败，设备活跃未满60天或者激活未满60天"
            , _block=("匹配err1的错误", 14, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="分期付款计划付清之前", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 16, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="解锁失败,此设备在ATT官方处于欠费状态"
            , _block=("匹配err1的错误", 17, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="数据库中找不到", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 19, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="解锁失败，在ATT官方无数据状态或者不是ATT运营商"
            , _block=("匹配err1的错误", 20, "设置变量"))
        #endif
        if xbot_visual.workflow.test(operand1=error_innerText, operator="in", operand2="丢失或被盗", operator_options="{\"ignoreCase\":\"True\"}", _block=("匹配err1的错误", 22, "IF 条件")):
            error_innerText = xbot_visual.programing.variable(value="解锁失败，此设备在ATT官方处于黑名单状态"
            , _block=("匹配err1的错误", 23, "设置变量"))
        #endif
    finally:
        args["error_innerText"] = error_innerText
